#include <stdio.h>
#define N 1000010
int a[N];

void insert(int l, int r, int c)
{
    a[l] += c;
    a[r + 1] -= c;
}

int main()
{
    int n, m;
    scanf("%d %d", &n, &m);
    for (int i = 1; i <= n; i++)
    {
        int c;
        scanf("%d", &c);
        insert(i, i, c);
    }

    while (m--)
    {
        int l, r, c;
        scanf("%d %d %d", &l, &r, &c);
        insert(l, r, c);
    }
    for (int i = 1; i <= n; i++)
    {
        a[i] += a[i - 1];
        printf("%d ", a[i]);
    }
    return 0;
}